<?php

namespace App\Transformers\Student;

use League\Fractal\TransformerAbstract;
use App\Models\Student\StudentSchoolCensus;

/**
 * Class StudentSchoolCensusTransformer
 * @package namespace App\Transformers\Student;
 */
class StudentSchoolCensusTransformer extends TransformerAbstract
{

    /**
     * Transform the \StudentSchoolCensus entity
     * @param \StudentSchoolCensus $model
     *
     * @return array
     */
    public function transform(StudentSchoolCensus $model)
    {
        return [
            'id'         => (int) $model->id,
            'student_id'    => (int) $model->student_id,
            'change_date'   =>  $model->change_date,
            'before_change'   =>  $model->before_change,
            'after_change'   =>  $model->after_change,
            'after_change'   =>  $model->after_change,
            'created_user'   =>  $model->created_user,
            'updated_user'   =>  $model->updated_user,
            'created_at' => $model->created_at->format('Y-m-d H:i:s'),
            'updated_at' => $model->updated_at->format('Y-m-d H:i:s')
        ];
    }
}
